package com.niit.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ProjectName: springBoot3-demo
 * @Package: com.niit.bean
 * @ClassName: Person
 * @Author: zjh
 * @description: TODO
 * @date: 2024/1/2 10:33
 * @version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Component //该注解不能少，只有是spring的组件的时候，才能和配置文件进行绑定
@ConfigurationProperties(prefix = "person") //和配置文件person前缀的所有配置进行绑定
public class Person {

    private String name;
    private Integer age;
    private Date birthDay;
    private Boolean like;
    private Child child; //嵌套对象
    private List<Dog> dogs; //数组（里面是对象）
    private Map<String,Cat> cats; //表示Map
}
